﻿using System.Configuration;
using WCF.Common.DAL;
namespace WCF.Common
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码、svc 和配置文件中的类名“UserService”。
    public class UserService : IUserService
    {

        readonly string USER_WORKTEAM = ConfigurationManager.AppSettings["USER_WORKTEAM"];
        readonly string CHECK_DOMAIN_URL = ConfigurationManager.AppSettings["CHECK_DOMAIN_URL"];

        /// <summary>
        /// 
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <param name="flag"></param>
        /// <returns></returns>
        public UserInfo GetUserInfo(string username, string password, string flag)
        {
            var user = new UserObjectDAL().SearchByKey(username);
            if (user == null) return null;
            return new UserInfo()
            {
                UserCode = user.ID,
                UserID = username,
                UserName = user.Caption,
                TeamName = USER_WORKTEAM
            };
        }
    }
}